import config from '@/config/app.js'

const {
    REDIRECT_PATH
} = config

const back = (delta) => {
    if (!delta) {
        delta = 1
    }
    uni.navigateBack({ delta: delta })
}

/**
 * @desc 登陆状态校验
 */
export const isLogin = (isLogin) => {
    if (!isLogin) {
        uni.navigateTo({ url: REDIRECT_PATH })
    } else {
        back()
    }
}